package multiThread;
/**
 * File: ThreadedDataCollector.java
 * TCSS 422 Team Project 1
 * Autumn 2009
 * Team Members: Darin Cyr, Kirk Leonard, John Patanian
 */

/**
 * A first in, Last Out Buffer for various types of Objects
 * @author Darin Cyr
 * @author Kirk Leonard
 * @author John Patanian
 * @version Autumn 2009
 * @param <T> The type of Object the WebCrawler Buffer will create.
 */
public interface WebCrawlerBuffer<T>
{
  /**
  * Adds an element of type T to the buffer.
  * @param the_element The element to add to the buffer.
  * @throws InterruptedException .
  */
  void add(T the_element)throws InterruptedException;

 /**
	 * Gets the last element from the Buffer.
	 * @return The last element.
	 */
  T get() throws InterruptedException;
  
  /**
   * Returns the number of elements in the buffer.
   * @return
   */
  int size();
  
  /**
   * The number of items that have been added to the buffer.
   */
  int count();
  
  /**
   * Indicates whether the buffer is empty or not.
   * @return true if the buffer has no elements.
   */
  boolean isEmpty();
  
  /**
   * Indicates whether the buffer contains a certain element.
   * @param the_element The element to check for.
   * @return A boolean indication.
   */
  boolean contains(T the_element);
  
}
